Attribute Types
Every attribute has a unique attribute type. QuickDraw 3D defines a large number of attribute types, and your application can define additional attribute types. Attribute types are defined by constants. Attribute type values greater than 0 are reserved for use by QuickDraw 3D. Your custom attribute types must have attribute type values that are less than 0. Here are the attribute types currently defined by QuickDraw 3D.
typedef enum TQ3AttributeTypes {
kQ3AttributeTypeNone = 0,
kQ3AttributeTypeSurfaceUV = 1,
kQ3AttributeTypeShadingUV = 2,
kQ3AttributeTypeNormal = 3,
kQ3AttributeTypeAmbientCoefficient = 4,
kQ3AttributeTypeDiffuseColor = 5,
kQ3AttributeTypeSpecularColor = 6,
kQ3AttributeTypeSpecularControl = 7,
kQ3AttributeTypeTransparencyColor = 8,
kQ3AttributeTypeSurfaceTangent = 9,
kQ3AttributeTypeHighlightState = 10,
kQ3AttributeTypeSurfaceShader = 11,
kQ3AttributeTypeNumTypes
} TQ3AttributeTypes;
Constant descriptions
-
kQ3AttributeTypeNone
-
The attribute has no type. You can pass this constant to the
Q3AttributeSet_GetNextAttributeType
function to get the first attribute type in an attribute set. When there are no more attribute types in a set,
Q3AttributeSet_GetNextAttributeType
returns
kQ3AttributeTypeNone
.
-
kQ3AttributeTypeSurfaceUV
-
The attribute is a surface
uv
parameterization, of type
TQ3Param2D
.
-
kQ3AttributeTypeShadingUV
-
The attribute is a shading
uv
parameterization, of type
TQ3Param2D
. A shading
uv
parameterization is an alternative to the surface
uv
parameterization that is used for shading. See the chapter
"Shader Objects"
for more information about shading
uv
parameterizations.
-
kQ3AttributeTypeNormal
-
The attribute is a surface normal, of type
TQ3Vector3D
.
-
kQ3AttributeTypeAmbientCoefficient
-
The attribute is an ambient coefficient, of type
float
. An
ambient coefficient
determines the amount of ambient light reflected from an object's surface. An ambient coefficient should be between 0.0 (no reflection of ambient light) and 1.0 (complete reflection of ambient light).
-
kQ3AttributeTypeDiffuseColor
-
The attribute is a diffuse color, of type
TQ3ColorRGB
.
-
kQ3AttributeTypeSpecularColor
-
The attribute is a specular color, of type
TQ3ColorRGB
.
-
kQ3AttributeTypeSpecularControl
-
The attribute is a specular control, of type
float
.
-
kQ3AttributeTypeTransparencyColor
-
The attribute is a transparency color, of type
TQ3ColorRGB
. A
transparency color
determines the amount of light that can pass through a surface. The color (0, 0, 0) indicates complete transparency, and (1, 1, 1) indicates complete opacity. QuickDraw 3D multiplies an object's transparency color by its diffuse color when a transparency color attribute is attached to the object.
-
kQ3AttributeTypeSurfaceTangent
-
The attribute is a surface tangent, of type
TQ3Tangent2D
.
-
kQ3AttributeTypeHighlightState
-
The attribute is a highlight state, of type
TQ3Boolean
. A highlight state determines whether a highlight style overrides the material attributes of an object (
kQ3True
) or not (
kQ3False
).
-
kQ3AttributeTypeSurfaceShader
-
The attribute is a surface shader, of type
TQ3SurfaceShaderObject
. See the chapter
"Shader Objects"
for information on creating surface shaders and adding them to attribute sets. Note that when you include a surface shader in an attribute set, the reference count of the shader is incremented.
-
kQ3AttributeTypeNumTypes
-
The number of attribute types currently defined.
© 1997 Apple Computer, Inc.
Previous | QD3D Book | Overview | Chapter Contents | Next |